/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "pydgtbinf")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Pydgtbinf.findAll", query = "SELECT p FROM Pydgtbinf p"),
    @NamedQuery(name = "Pydgtbinf.findByPydgtbinfid", query = "SELECT p FROM Pydgtbinf p WHERE p.pydgtbinfid = :pydgtbinfid"),
    @NamedQuery(name = "Pydgtbinf.findByFechaimpresion", query = "SELECT p FROM Pydgtbinf p WHERE p.fechaimpresion = :fechaimpresion"),
    @NamedQuery(name = "Pydgtbinf.findByDescripcion", query = "SELECT p FROM Pydgtbinf p WHERE p.descripcion = :descripcion")})
public class Pydgtbinf implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "pydgtbinfid")
    private Integer pydgtbinfid;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fechaimpresion")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaimpresion;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "descripcion")
    private String descripcion;
    @JoinColumn(name = "scthtbdatosgenid", referencedColumnName = "scthtbdatosgenid")
    @ManyToOne(optional = false)
    private Scthtbdatosgen scthtbdatosgenid;
    @JoinColumn(name = "pydgtbtipinfid", referencedColumnName = "pydgtbtipinfid")
    @ManyToOne(optional = false)
    private Pydgtbtipinf pydgtbtipinfid;
    @JoinColumn(name = "pydgtbproyecid", referencedColumnName = "pydgtbproyecid")
    @ManyToOne(optional = false)
    private Pydgtbproyec pydgtbproyecid;

    public Pydgtbinf() {
    }

    public Pydgtbinf(Integer pydgtbinfid) {
        this.pydgtbinfid = pydgtbinfid;
    }

    public Pydgtbinf(Integer pydgtbinfid, Date fechaimpresion, String descripcion) {
        this.pydgtbinfid = pydgtbinfid;
        this.fechaimpresion = fechaimpresion;
        this.descripcion = descripcion;
    }

    public Integer getPydgtbinfid() {
        return pydgtbinfid;
    }

    public void setPydgtbinfid(Integer pydgtbinfid) {
        this.pydgtbinfid = pydgtbinfid;
    }

    public Date getFechaimpresion() {
        return fechaimpresion;
    }

    public void setFechaimpresion(Date fechaimpresion) {
        this.fechaimpresion = fechaimpresion;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public Scthtbdatosgen getScthtbdatosgenid() {
        return scthtbdatosgenid;
    }

    public void setScthtbdatosgenid(Scthtbdatosgen scthtbdatosgenid) {
        this.scthtbdatosgenid = scthtbdatosgenid;
    }

    public Pydgtbtipinf getPydgtbtipinfid() {
        return pydgtbtipinfid;
    }

    public void setPydgtbtipinfid(Pydgtbtipinf pydgtbtipinfid) {
        this.pydgtbtipinfid = pydgtbtipinfid;
    }

    public Pydgtbproyec getPydgtbproyecid() {
        return pydgtbproyecid;
    }

    public void setPydgtbproyecid(Pydgtbproyec pydgtbproyecid) {
        this.pydgtbproyecid = pydgtbproyecid;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pydgtbinfid != null ? pydgtbinfid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pydgtbinf)) {
            return false;
        }
        Pydgtbinf other = (Pydgtbinf) object;
        if ((this.pydgtbinfid == null && other.pydgtbinfid != null) || (this.pydgtbinfid != null && !this.pydgtbinfid.equals(other.pydgtbinfid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Pydgtbinf[ pydgtbinfid=" + pydgtbinfid + " ]";
    }
    
}
